filename="renren_accounts.txt"
fin = open(filename)
left=[]
numbers=[]
for line in fin.readlines():
	if len(line)>1:
		tmp = line.split('&')
		try:
			if "id=" in tmp[1]:
				numbers.append(tmp[1][3:])
			else:
				tmp =line.split('/')
				numbers.append(tmp[3])

		except:
			left.append(line)
fout = open("accounts.txt","w")
for number in numbers:
	fout.write("http://www.renren.com/"+number+"/profile\n")
